package com.omazan.nativeClient;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


import com.omazan.db.HandleCustomers;
import com.omazan.db.models.Customer;
import com.omazan.utils.OmazanException;

public class UserOperations {


	
	BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

	public void usertypeOperations() throws OmazanException, IOException 
	{
		int z=0;
		while(z==0)
		{
			System.out.println("");
			System.out.println("Select User Operation Type");
			System.out.println("1.ADD USERS");
			System.out.println("2.DELETE USERS");
			System.out.println("3.DISPLAY USERS");
			System.out.println("4.EXIT");
			String userInput = input.readLine();
			int operation = Integer.parseInt(userInput);
						
			switch(operation)
			{
			case 1:
				UserAddOperations ua = new UserAddOperations();
				ua.usertypeAddOperations();
				
				
				break;
			case 2:
				UserDeleteOperations ud = new UserDeleteOperations();
				ud.usertypeDeleteOperations();
				break;
			case 3:
				UserDisplayOperations udis = new UserDisplayOperations();
				udis.usertypeDisplayOperations();
				break;
			case 4:
				z++;
				break;
			
				default:
					z++;
					break;
			}
		}
		
			}
		
	public void productOperations() throws OmazanException, IOException {

		int x=0;
		while (x==0) {
			System.out.println("");
			System.out.println("Please select an operation:");
			System.out.println("1.ADD NEW PRODUCTS");
			System.out.println("2.ADD NEW PRODUCT TYPES");
			System.out.println("3.DELETE PRODUCTS");
			System.out.println("4.DELETE PRODUCT TYPE");
			System.out.println("5.DISPLAY PRODUCTS");
			System.out.println("6.DISPLAY PRODUCT TYPES");
			System.out.println("7.BACK TO PREVIOUS MENU");
			String userInput = input.readLine();
			int operation = Integer.parseInt(userInput);
			switch(operation)
			{
			case 1:
				ProdOperations ap = new ProdOperations();
				ap.addProd();
				break;
			case 2:
				ProdTypeOperations apt = new ProdTypeOperations();
				apt.addProdType();
				break;
			case 3:
				ProdOperations adp = new ProdOperations();
				adp.delProd();
				break;
			case 4:
				ProdTypeOperations adpt = new ProdTypeOperations();
				adpt.delProdType();
				break;
			case 5:
				ProdOperations disp = new ProdOperations();
				disp.dispProd();
				break;
			case 6:
				ProdTypeOperations dispt = new ProdTypeOperations();
				dispt.dispProdType();
				break;
			case 7:
				x++;
				System.out.println("");
				break;
				default:
					break;
			}
			
					

		}
	}
}
